package com.songlanyun.modules.userbankcard.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.songlanyun.common.enums.MemberConstant;
import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.modules.userbankcard.entity.UserBankCardEntity;
import com.songlanyun.modules.userbankcard.model.dto.UserBankCardDTO;

import java.util.List;
import java.util.Map;

/**
 * 会员的银行卡
 *
 * @author lubo
 * @email sunlightcs@gmail.com
 * @date 2020-12-08 13:56:16
 */
public interface UserBankCardService extends IService<UserBankCardEntity> {

    PageUtils queryPage(Map<String, Object> params);

    UserBankCardEntity getById(Long id, boolean isThrow);

    List<UserBankCardEntity> bankCardList(MemberConstant.UserType userType, Long identityId);

    /**
     * 获得默认银行卡
     * @param userType
     * @param identityId
     * @return
     */
    UserBankCardEntity defaultBankCard(MemberConstant.UserType userType, Long identityId);

    void saveBankCard(UserBankCardDTO dto, MemberConstant.UserType userType, Long identityId);

    /**
     * 设置默认银行卡
     * @param id
     */
    void setDefaultBankCard(MemberConstant.UserType userType, Long identityId,Long id);

    PageUtils shopBankCardList(Map<String, Object> params);

    List<UserBankCardEntity> shopBankCards(Map<String, Object> params);

    UserBankCardEntity loadById(Long userId, Long userBankId, boolean tw);
}

